﻿using System.Windows;
using System.Windows.Input;
using IP20.Procdure;
using IP20.ViewModel;

namespace IP20.View
{
    /// <summary>
    /// UserEditView.xaml 的交互逻辑
    /// </summary>
    public partial class UserEditView : Window
    {
        public UserEditView(UserEntity user)
        {
            InitializeComponent();
            var model = new UserEditViewModel();
            this.DataContext = model;
            if (user != null)
            {
                var u = model.LoginModel;
                u.UserName = user.UserName;
                u.Password = user.Password;
                u.UserLevel = user.UserLevel;
            }
        }

        private void WinMove_LeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.LeftButton == MouseButtonState.Pressed)
                this.DragMove();
        }
    }
}